#include "longutils.h"



void lookupProg(Key root, Key* newRoot, std::string mode, std::string* newMode, float ch)
{
	switch (root)
	{
	case A: //{"AMAJ", "BMIN", "DBMIN", "DMAJ", "EMAJ", "GBMIN"};
		switch ((int)ch) {
		case 2:
			newRoot[0] = B;
			newMode[0] = "Dorian";
			break;
		case 3:
			newRoot[0] = Db;
			newMode[0] = "Dorian";
			break;
		case 4:
			newRoot[0] = D;
			newMode[0] = "Major";
			break;
		case 5:
			newRoot[0] = E;
			newMode[0] = "Major";
			break;
		case 6:
			newRoot[0] = Gb;
			newMode[0] = "Dorian";
			break;
		case 1:
		default:
			newRoot[0] = A;
			newMode[0] = "Major";
			break;
		}
		break;
	case B: //{"BMAJ", "DBMIN", "EBMIN", "EMAJ", "GBMAJ", "ABMIN"};
		switch ((int)ch) {
		case 2:
			newRoot[0] = Db;
			newMode[0] = "Dorian";
			break;
		case 3:
			newRoot[0] = Eb;
			newMode[0] = "Dorian";
			break;
		case 4:
			newRoot[0] = E;
			newMode[0] = "Major";
			break;
		case 5:
			newRoot[0] = Gb;
			newMode[0] = "Major";
			break;
		case 6:
			newRoot[0] = Ab;
			newMode[0] = "Dorian";
			break;
		case 1:
		default:
			newRoot[0] = B;
			newMode[0] = "Major";
			break;
		}
		break;
	case D: //{"DMAJ", "EMIN", "GBMIN", "GMAJ", "AMAJ", "BMIN"};
		switch ((int)ch) {
		case 2:
			newRoot[0] = E;
			newMode[0] = "Dorian";
			break;
		case 3:
			newRoot[0] = Gb;
			newMode[0] = "Dorian";
			break;
		case 4:
			newRoot[0] = G;
			newMode[0] = "Major";
			break;
		case 5:
			newRoot[0] = A;
			newMode[0] = "Major";
			break;
		case 6:
			newRoot[0] = B;
			newMode[0] = "Dorian";
			break;
		case 1:
		default:
			newRoot[0] = D;
			newMode[0] = "Major";
			break;
		}
		break;
	case E: //{"EMAJ", "GBMIN", "ABMIN", "AMAJ", "BMAJ", "DBMIN"};
		switch ((int)ch) {
		case 2:
			newRoot[0] = Gb;
			newMode[0] = "Dorian";
			break;
		case 3:
			newRoot[0] = Ab;
			newMode[0] = "Dorian";
			break;
		case 4:
			newRoot[0] = A;
			newMode[0] = "Major";
			break;
		case 5:
			newRoot[0] = B;
			newMode[0] = "Major";
			break;
		case 6:
			newRoot[0] = Db;
			newMode[0] = "Dorian";
			break;
		case 1:
		default:
			newRoot[0] = E;
			newMode[0] = "Major";
			break;
		}
		break;
	case F: //{"FMAJ", "GMIN", "AMIN", "BBMAJ", "CMAJ", "DMIN"};
		switch ((int)ch) {
		case 2:
			newRoot[0] = G;
			newMode[0] = "Dorian";
			break;
		case 3:
			newRoot[0] = A;
			newMode[0] = "Dorian";
			break;
		case 4:
			newRoot[0] = Bb;
			newMode[0] = "Major";
			break;
		case 5:
			newRoot[0] = C;
			newMode[0] = "Major";
			break;
		case 6:
			newRoot[0] = D;
			newMode[0] = "Dorian";
			break;
		case 1:
		default:
			newRoot[0] = F;
			newMode[0] = "Major";
			break;
		}
		break;
	case G: //{"GMAJ", "AMIN", "BMIN", "CMAJ", "DMAJ", "EMIN"};
		switch ((int)ch) {
		case 2:
			newRoot[0] = A;
			newMode[0] = "Dorian";
			break;
		case 3:
			newRoot[0] = B;
			newMode[0] = "Dorian";
			break;
		case 4:
			newRoot[0] = C;
			newMode[0] = "Major";
			break;
		case 5:
			newRoot[0] = D;
			newMode[0] = "Major";
			break;
		case 6:
			newRoot[0] = E;
			newMode[0] = "Dorian";
			break;
		case 1:
		default:
			newRoot[0] = G;
			newMode[0] = "Major";
			break;
		}
		break;
	case Ab: //{"ABMAJ", "BBMIN", "CMIN", "DBMAJ", "EBMAJ", "FMIN"}
		switch ((int)ch) {
		case 2:
			newRoot[0] = Bb;
			newMode[0] = "Dorian";
			break;
		case 3:
			newRoot[0] = C;
			newMode[0] = "Dorian";
			break;
		case 4:
			newRoot[0] = Db;
			newMode[0] = "Major";
			break;
		case 5:
			newRoot[0] = Eb;
			newMode[0] = "Major";
			break;
		case 6:
			newRoot[0] = F;
			newMode[0] = "Dorian";
			break;
		case 1:
		default:
			newRoot[0] = Ab;
			newMode[0] = "Major";
			break;
		}
		break;
	case Bb: //{"BBMAJ", "CMIN", "DMIN", "EBMAJ", "FMAJ", "GMIN"};
		switch ((int)ch) {
		case 2:
			newRoot[0] = C;
			newMode[0] = "Dorian";
			break;
		case 3:
			newRoot[0] = D;
			newMode[0] = "Dorian";
			break;
		case 4:
			newRoot[0] = Eb;
			newMode[0] = "Major";
			break;
		case 5:
			newRoot[0] = F;
			newMode[0] = "Major";
			break;
		case 6:
			newRoot[0] = G;
			newMode[0] = "Dorian";
			break;
		case 1:
		default:
			newRoot[0] = Bb;
			newMode[0] = "Major";
			break;
		}
		break;
	case Db: //{"DBMAJ", "EBMIN", "FMIN", "GBMAJ", "ABMAJ", "BBMIN"};
		switch ((int)ch) {
		case 2:
			newRoot[0] = Eb;
			newMode[0] = "Dorian";
			break;
		case 3:
			newRoot[0] = F;
			newMode[0] = "Dorian";
			break;
		case 4:
			newRoot[0] = Gb;
			newMode[0] = "Major";
			break;
		case 5:
			newRoot[0] = Ab;
			newMode[0] = "Major";
			break;
		case 6:
			newRoot[0] = Bb;
			newMode[0] = "Dorian";
			break;
		case 1:
		default:
			newRoot[0] = Db;
			newMode[0] = "Major";
			break;
		}
		break;
	case Eb: //{"EBMAJ", "FMIN", "GMIN", "ABMAJ", "BBMAJ", "CMIN"};
		switch ((int)ch) {
		case 2:
			newRoot[0] = F;
			newMode[0] = "Dorian";
			break;
		case 3:
			newRoot[0] = G;
			newMode[0] = "Dorian";
			break;
		case 4:
			newRoot[0] = Ab;
			newMode[0] = "Major";
			break;
		case 5:
			newRoot[0] = Bb;
			newMode[0] = "Major";
			break;
		case 6:
			newRoot[0] = C;
			newMode[0] = "Dorian";
			break;
		case 1:
		default:
			newRoot[0] = Eb;
			newMode[0] = "Major";
			break;
		}
		break;
	case Gb: //{"GBMAJ", "ABMIN", "BBMIN", "BMAJ", "DBMAJ", "EBMIN"};
		switch ((int)ch) {
		case 2:
			newRoot[0] = Ab;
			newMode[0] = "Dorian";
			break;
		case 3:
			newRoot[0] = Bb;
			newMode[0] = "Dorian";
			break;
		case 4:
			newRoot[0] = B;
			newMode[0] = "Major";
			break;
		case 5:
			newRoot[0] = Db;
			newMode[0] = "Major";
			break;
		case 6:
			newRoot[0] = Eb;
			newMode[0] = "Dorian";
			break;
		case 1:
		default:
			newRoot[0] = Gb;
			newMode[0] = "Major";
			break;
		}
		break;
	case C: //{"CMAJ", "DMIN", "EMIN", "FMAJ", "GMAJ", "AMIN"};
	default: //{"CMAJ", "DMIN", "EMIN", "FMAJ", "GMAJ", "AMIN"};
		switch ((int)ch) {
		case 2:
			newRoot[0] = D;
			newMode[0] = "Dorian";
			break;
		case 3:
			newRoot[0] = E;
			newMode[0] = "Dorian";
			break;
		case 4:
			newRoot[0] = F;
			newMode[0] = "Major";
			break;
		case 5:
			newRoot[0] = G;
			newMode[0] = "Major";
			break;
		case 6:
			newRoot[0] = A;
			newMode[0] = "Dorian";
			break;
		case 1:
		default:
			newRoot[0] = C;
			newMode[0] = "Major";
			break;
		}
		break;
			
	}
}